package com.iss.apartmentmanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iss.apartmentmanage.entity.RoomManage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;


@Repository
@Mapper
public interface RoomManagerMapper extends BaseMapper<RoomManage> {

    @Update("<script> update room_manage set is_used=#{isUser} where id in " +
            "       <foreach collection=\"id\" item=\"id\" separator=\",\" open=\"(\" close=\")\">" +
            "          #{id}" +
            "       </foreach>" +
            "</script>")
     Integer updateIsUsedByRoomIds(String[] id,int isUser);

    @Update("update room_manage set status =#{status} where id=#{roomId}")
    Integer updateIsDeleteByRoomIds(Integer status,Integer roomId);



}
